package com.xxjh.brs;

import com.xxjh.brs.scheduler.FtpTransferDynamicScheduledService;
import com.xxjh.brs.uavmodeling.service.UavModelingService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * @author CHENCHEN
 * @title 启动加载任务判断
 * @company 新兴际华科技（天津）有限公司
 * @create 2024-06-20 14:03
 */
@Slf4j
@Component
public class StartupEventListener implements ApplicationListener<ApplicationReadyEvent> {

    @Autowired
    private FtpTransferDynamicScheduledService ftpTransferDynamicScheduledService;

    @Autowired
    private UavModelingService uavModelingService;

    @Override
    public void onApplicationEvent(ApplicationReadyEvent applicationReadyEvent) {
        ftpTransferDynamicScheduledService.reloadTask();
        uavModelingService.initLoading();
    }
}
